package com.wu.dao;

import com.wu.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @author wuyanshen
 * @date 2019-01-21 11:34 AM
 * @discription 描述
 */
@Repository
public class UserDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public User getUser(User user) {
        String sql = "insert into user (id,name) values (?,?)";
        jdbcTemplate.update(sql,user.getId(),user.getName());
        System.out.println("UserDao执行了");
        return user;
    }
}
